package com.cy.module.common.pool;

import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

//构建对象池类型，将此类型的对象交给spring管理
@Lazy
@Component
public class ObjectPool {
    //byte[]array=new byte[1024*1024];
    //定义无参构造函数，监控spring框架何时构建此类对象
    public ObjectPool(){
        System.out.println("ObjectPool");
    }
    @PostConstruct
    public void init(){
        System.out.println("init()");
    }
    @PreDestroy
    public void destory(){
        System.out.println("destory()");
    }
}
